// 引入封装好的axios
import request from '@/utils/request'
// 获取新闻文章详情
export const getArticles = articleId => request({
  url: `/app/v1_0/articles/${articleId}`
})
// 关注用户
export const focusUser = target => request({
  method: 'post',
  url: '/app/v1_0/user/followings',
  data: {
    target
  }
})
// 取消关注用户
export const unfollowUser = target => request({
  method: 'DELETE',
  url: `/app/v1_0/user/followings/${target}`
})
// 收藏文章
export const collectArticle = target => request({
  method: 'POST',
  url: '/app/v1_0/article/collections',
  data: {
    target
  }
})
// 取消收藏
export const cancelCollect = target => request({
  method: 'DELETE',
  url: `/app/v1_0/article/collections/${target}`
})
// 对文章点赞
export const giveLike = target => request({
  method: 'POST',
  url: '/app/v1_0/article/likings',
  data: {
    target
  }
})
// 取消点赞
export const cancelLike = target => request({
  method: 'DELETE',
  url: `/app/v1_0/article/likings/${target}`
})
